//
//  JCObjectSerializer.h
//  JCSDK
//
//  Created by master on 16/2/23.
//  Copyright © 2016年 AdMaster. All rights reserved.


#import <libkern/OSAtomic.h>
#import "JCSequenceGenerator.h"

@implementation JCSequenceGenerator

{
    int32_t _value;
}

- (instancetype)init
{
    return [self initWithInitialValue:0];
}

- (instancetype)initWithInitialValue:(int32_t)initialValue
{
    self = [super init];
    if (self) {
        _value = initialValue;
    }

    return self;
}

- (int32_t)nextValue
{
    return OSAtomicAdd32(1, &_value);
}

@end
